<!DOCTYPE html>
<script type="text/javascript" src="../js/angular.min.js"></script>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<div ng-app="myApp" ng-controller="myController">
			姓名：<input type="text" name="name" ng-model="name"/><br>
			hello：{{name}}
			<br>
			hello2：<div ng-bind="name"></div>
			<br>
			<input type="button" value="清空" ng-click="name=''" /><br>
			<input type="button" value="清空2" ng-click="cleanValue()" />
		</div>
	</body>
</html>
<script>
	var app = angular.module("myApp",[]);
	// 注入：
//	app.controller("myController",function($scope){
//		$scope.name = "传智播客.黑马程序员"; // 初始化表单
//	})
	app.controller("myController",["$scope",function($scope){
		$scope.name = "传智播客.黑马程序员"; // 初始化表单
		// 定义方法：
		$scope.cleanValue = function(){
			$scope.name = "";
		}
	}])
</script>
